package com.eptok.gw.szcups.pojo;

import org.dom4j.Document;
import org.dom4j.Element;

import ys8583.parse.IOMessage;


public class BkCardBncQry extends XmlMessage{
	
	private PosData posData;
///////////////////////////////////////////
	private String accountAmt;
	private CupsResult cupsResult;
	
	public PosData getPosData() {
		return posData;
	}

	public void setPosData(PosData posData) {
		this.posData = posData;
	}

	public String getAccountAmt() {
		return accountAmt;
	}

	public void setAccountAmt(String accountAmt) {
		this.accountAmt = accountAmt;
	}

	public CupsResult getCupsResult() {
		return cupsResult;
	}

	public void setCupsResult(CupsResult cupsResult) {
		this.cupsResult = cupsResult;
	}


	@Override
	protected void decodeBody(Document document) throws Exception {
		reqSerialNumber = ((Element) document.selectObject("/szcups/body/ReqSerialNumber")).getTextTrim();
		posData = decodePosData(document);
		
	}

	@Override
	protected String encodeBody(IOMessage iomessage) throws Exception {
		StringBuffer sb = new StringBuffer();
		sb.append("<body>");
		sb.append("<ReqSerialNumber>").append(reqSerialNumber).append("</ReqSerialNumber>");
		sb.append("<RspSerialNumber>").append(rspSerialNumber).append("</RspSerialNumber>");
		sb.append("<busiResult>");
		sb.append("<AccountAmt>").append(accountAmt).append("</AccountAmt>");
		sb.append("</busiResult>");
		sb.append(encodeCupsResult(iomessage));
		sb.append("</body>");
		return sb.toString();
	}
	
	
	
}
